////////////////////////////////////////////////
//	File			:	"CSkillsUpgradeState.cpp"
//
//	Author			:	Steven Seufert (SMS)
//			
//	Last Modified	:	January 22, 2012
//
//	Purpose			:	To implement the Spells Select state 
/////////////////////////////////////////////////
#include "CSkillsUpgradeState.h"
#include "CGamePlayState.h"
#include "CGame.h"
#include "SGD Wrappers\CSGD_TextureManager.h"
#include "SGD Wrappers\CSGD_Direct3D.h"
#include "SGD Wrappers\CSGD_DirectInput.h"
#include "SGD Wrappers\CSGD_FModManager.h"
#include "CBitmapFont.h"
#include "Globals.h"

#include "CHud.h"
#include "CMainMenuState.h"

CSkillsUpgradeState::CSkillsUpgradeState( void )
{
	
}
CSkillsUpgradeState::~CSkillsUpgradeState(void)
{

}
CSkillsUpgradeState* CSkillsUpgradeState::GetInstance( void )
{
	//	Lazy instantiation
	static CSkillsUpgradeState instance;
	return &instance;
}
void CSkillsUpgradeState::Enter(void)
{
	m_nMenuSelectionOne = 0;
	m_nMenuSelectionTwo = 0;
	m_nPage = 0;

	m_nFXVolume = CGame::GetInstance()->GetSFXVolume();
	m_nMusicVolume = CGame::GetInstance()->GetMusicVolume();
	m_nMusicPan = CGame::GetInstance()->GetPanVolume();
	
	m_nCursorID = CSGD_TextureManager::GetInstance()->LoadTexture( "resources//graphics//SGD_MenuCursor.png" );

	//TODO:
	/*m_nSFX = CSGD_FModManager::GetInstance()->LoadSound("resources/sounds/StS_fox061.wav");
	m_nBGM = CSGD_FModManager::GetInstance()->LoadSound("resources//music//StS_01_prologue_-_cirrus.OGG", FMOD_LOOP_NORMAL);

	CSGD_FModManager::GetInstance()->SetVolume(m_nBGM,CGame::GetInstance()->GetMusicVolume());
	CSGD_FModManager::GetInstance()->SetPan(m_nBGM,CGame::GetInstance()->GetPanVolume());

	CSGD_FModManager::GetInstance()->PlaySound(m_nBGM);*/
}
bool CSkillsUpgradeState::Input(void)
{
	// PLAYER ONE UP SELECTION
	// if the user goes up from the top selection, send the cursor to the last selection
	if(CSGD_DirectInput::GetInstance()->KeyPressed(DIK_UP) )
	{
		switch(m_nPage)
		{
		case 0:
			{
				m_nMenuSelectionOne -= 1;

				// only one school on this page, so skip down to Turn Page Back
				if (m_nMenuSelectionOne > 7 && m_nMenuSelectionOne < SKILLSMENU_FORWARD)
					m_nMenuSelectionOne = 7;

				if( m_nMenuSelectionOne == -1 )
				{
					// go to the bottom selection of this page
					m_nMenuSelectionOne = SKILLSMENU_FORWARD;
				}
			}
			break;

		case 1:
			{
				m_nMenuSelectionOne -= 1;

				if( m_nMenuSelectionOne == -1 )
				{
					// go to the bottom selection of this page
					m_nMenuSelectionOne = SKILLSMENU_FORWARD;
				}
			}
			break;

		case 2:
			{
				m_nMenuSelectionOne -= 1;

				// only one school on this page, so skip down to Turn Page Back
				if (m_nMenuSelectionOne > 3 && m_nMenuSelectionOne < SKILLSMENU_BACK)
					m_nMenuSelectionOne = 3;

				if( m_nMenuSelectionOne == -1 )
				{
					// go to the bottom selection of this page
					m_nMenuSelectionOne = SKILLSMENU_BACK;
				}
			}
			break;
		}
	}

	// PLAYER TWO UP SELECTION
	// if the user goes up from the top selection, send the cursor to the last selection
	if(CSGD_DirectInput::GetInstance()->KeyPressed(DIK_W) )
	{
		switch(m_nPage)
		{
		case 0:
			{
				m_nMenuSelectionTwo -= 1;

				// only one school on this page, so skip down to Turn Page Back
				if (m_nMenuSelectionTwo > 7 && m_nMenuSelectionTwo < SKILLSMENU_FORWARD)
					m_nMenuSelectionTwo = 7;

				if( m_nMenuSelectionTwo == -1 )
				{
					// go to the bottom selection of this page
					m_nMenuSelectionTwo = SKILLSMENU_FORWARD;
				}
			}
			break;

		case 1:
			{
				m_nMenuSelectionTwo -= 1;

				if( m_nMenuSelectionTwo == -1 )
				{
					// go to the bottom selection of this page
					m_nMenuSelectionTwo = SKILLSMENU_FORWARD;
				}
			}
			break;

		case 2:
			{
				m_nMenuSelectionTwo -= 1;

				// only one school on this page, so skip down to Turn Page Back
				if (m_nMenuSelectionTwo > 3 && m_nMenuSelectionTwo < SKILLSMENU_BACK)
					m_nMenuSelectionTwo = 3;

				if( m_nMenuSelectionTwo == -1 )
				{
					// go to the bottom selection of this page
					m_nMenuSelectionTwo = SKILLSMENU_BACK;
				}
			}
			break;
		}
	}

	// PLAYER ONE DOWN SELECTION
	// if the user goes down from the final selection, send the cursor to the first selection
	switch(m_nPage)
	{
	case 0:
		{
			if(CSGD_DirectInput::GetInstance()->KeyPressed(DIK_DOWN) )
			{
				m_nMenuSelectionOne += 1;

				// only one school on this page, so skip down to Turn Page Back
				if (m_nMenuSelectionOne > 7 && m_nMenuSelectionOne < SKILLSMENU_FORWARD)
					m_nMenuSelectionOne = SKILLSMENU_FORWARD;

				// if the cursor goes past the bottom selection of this page
				if( m_nMenuSelectionOne > SKILLSMENU_FORWARD )
				{
					m_nMenuSelectionOne = 0;
				}

			}
		}
		break;

	case 1:
		{
			if(CSGD_DirectInput::GetInstance()->KeyPressed(DIK_DOWN) )
			{
				m_nMenuSelectionOne += 1;

				// if the cursor goes past the bottom selection of this page
				if( m_nMenuSelectionOne > SKILLSMENU_FORWARD )
				{
					m_nMenuSelectionOne = 0;
				}

			}
		}
		break;

	case 2:
		{
			if(CSGD_DirectInput::GetInstance()->KeyPressed(DIK_DOWN) )
			{
				m_nMenuSelectionOne += 1;

				// only one school on this page, so skip down to Turn Page Back
				if (m_nMenuSelectionOne > 3 && m_nMenuSelectionOne < SKILLSMENU_BACK)
					m_nMenuSelectionOne = SKILLSMENU_BACK;

				// if the cursor goes past the bottom selection of this page
				if( m_nMenuSelectionOne > SKILLSMENU_BACK )
				{
					m_nMenuSelectionOne = 0;
				}

			}
		}
		break;
	}

	// PLAYER TWO DOWN SELECTION
	// if the user goes down from the final selection, send the cursor to the first selection
	switch(m_nPage)
	{
	case 0:
		{
			if(CSGD_DirectInput::GetInstance()->KeyPressed(DIK_S) )
			{
				m_nMenuSelectionTwo += 1;

				// only one school on this page, so skip down to Turn Page Back
				if (m_nMenuSelectionTwo > 7 && m_nMenuSelectionTwo < SKILLSMENU_FORWARD)
					m_nMenuSelectionTwo = SKILLSMENU_FORWARD;

				// if the cursor goes past the bottom selection of this page
				if( m_nMenuSelectionTwo > SKILLSMENU_FORWARD )
				{
					m_nMenuSelectionTwo = 0;
				}

			}
		}
		break;

	case 1:
		{
			if(CSGD_DirectInput::GetInstance()->KeyPressed(DIK_S) )
			{
				m_nMenuSelectionTwo += 1;

				// if the cursor goes past the bottom selection of this page
				if( m_nMenuSelectionTwo > SKILLSMENU_FORWARD )
				{
					m_nMenuSelectionTwo = 0;
				}

			}
		}
		break;

	case 2:
		{
			if(CSGD_DirectInput::GetInstance()->KeyPressed(DIK_S) )
			{
				m_nMenuSelectionTwo += 1;

				// only one school on this page, so skip down to Turn Page Back
				if (m_nMenuSelectionTwo > 3 && m_nMenuSelectionTwo < SKILLSMENU_BACK)
					m_nMenuSelectionTwo = SKILLSMENU_BACK;

				// if the cursor goes past the bottom selection of this page
				if( m_nMenuSelectionTwo > SKILLSMENU_BACK )
				{
					m_nMenuSelectionTwo = 0;
				}

			}
		}
		break;
	}

	// PLAYER ONE TURNING THE PAGE
	switch(m_nPage)
	{
	case 0: // on pages one or two
	case 1:
		{	 // if the user presses right or left while at turn page 
			if(CSGD_DirectInput::GetInstance()->KeyReleased(DIK_RIGHT) ||CSGD_DirectInput::GetInstance()->KeyReleased(DIK_LEFT) ||CSGD_DirectInput::GetInstance()->KeyReleased(DIK_RETURN))
			{
				switch (m_nMenuSelectionOne)
				{
					// when the cursor is at back
				case SKILLSMENU_BACK:
					{
						if (m_nPage > 0)
							m_nPage--;		
						// if you land on the first page, move the cursor to Turn Page Forward
						if (m_nPage == 0)
						{
							m_nMenuSelectionOne = SKILLSMENU_FORWARD;
							m_nMenuSelectionTwo = SKILLSMENU_FORWARD;
						}
					}
					break;	
				
					// when the cursor is at forward
				case SKILLSMENU_FORWARD:
					{
						if (m_nPage < (NUM_PAGES_SPELLS_SELECTION - 1))
							m_nPage++;		
						// if you land on the last page, move the cursor up to Turn Page Back
						if (m_nPage == (NUM_PAGES_SPELLS_SELECTION - 1))
						{
							m_nMenuSelectionOne = SKILLSMENU_BACK;
							m_nMenuSelectionTwo = SKILLSMENU_BACK;
						}
					}
					break;	
				}
			}
		}		
			break;

	case 2:
		{
			 // if the user presses right or left while at turn page 
			if(CSGD_DirectInput::GetInstance()->KeyReleased(DIK_RIGHT) ||CSGD_DirectInput::GetInstance()->KeyReleased(DIK_LEFT) ||CSGD_DirectInput::GetInstance()->KeyReleased(DIK_RETURN))
			{
				switch (m_nMenuSelectionOne)
				{
					// when the cursor is at back
				case SKILLSMENU_BACK:
					{
						if (m_nPage > 0)
							m_nPage--;							
					}
					break;	
				}
			}
		}
		break;
	} // end switch (page)

	// PLAYER TWO TURNING THE PAGE
	switch(m_nPage)
	{
	case 0: // on pages one or two
	case 1:
		{	 // if the user presses right or left while at turn page 
			if(CSGD_DirectInput::GetInstance()->KeyReleased(DIK_D) ||CSGD_DirectInput::GetInstance()->KeyReleased(DIK_A) ||CSGD_DirectInput::GetInstance()->KeyReleased(DIK_RETURN))
			{
				switch (m_nMenuSelectionTwo)
				{
					// when the cursor is at back
				case SKILLSMENU_BACK:
					{
						if (m_nPage > 0)
							m_nPage--;		
						// if you land on the first page, move the cursor to Turn Page Forward
						if (m_nPage == 0)
						{
							m_nMenuSelectionOne = SKILLSMENU_FORWARD;
							m_nMenuSelectionTwo = SKILLSMENU_FORWARD;
						}
					}
					break;	
				
					// when the cursor is at forward
				case SKILLSMENU_FORWARD:
					{
						if (m_nPage < (NUM_PAGES_SPELLS_SELECTION - 1))
							m_nPage++;		
						// if you land on the last page, move the cursor up to Turn Page Back
						if (m_nPage == (NUM_PAGES_SPELLS_SELECTION - 1))
						{
							m_nMenuSelectionOne = SKILLSMENU_BACK;
							m_nMenuSelectionTwo = SKILLSMENU_BACK;
						}
					}
					break;	
				}
			}
		}		
			break;

	case 2:
		{
			 // if the user presses right or left while at turn page 
			if(CSGD_DirectInput::GetInstance()->KeyReleased(DIK_D) ||CSGD_DirectInput::GetInstance()->KeyReleased(DIK_A) ||CSGD_DirectInput::GetInstance()->KeyReleased(DIK_RETURN))
			{
				switch (m_nMenuSelectionOne)
				{
					// when the cursor is at back
				case SKILLSMENU_BACK:
					{
						if (m_nPage > 0)
							m_nPage--;							
					}
					break;	
				}
			}
		}
		break;
	} // end switch (page)
	

	//FOR TESTING PURPOSES ONLY
	if( CSGD_DirectInput::GetInstance()->KeyPressed(DIK_ESCAPE) )
	{
		
		CGame::GetInstance()->ChangeState( CMainMenuState::GetInstance() );		
	}

	///////////////////////////////////////
	// TODO: handle key binding and exiting
	///////////////////////////////////////

	
	//success
	return true;
}
void CSkillsUpgradeState::Update(float fElapsedTime)
{
	//TODO:
	/*if( !CSGD_FModManager::GetInstance()->IsSoundPlaying(m_nBGM) )
		CSGD_FModManager::GetInstance()->PlaySound(m_nBGM);*/
}
void CSkillsUpgradeState::Render(void)
{
	
	char buffer[255];
	CBitmapFont::GetInstance()->SetScale(1.0f);
	RECT rSkillsTitle = {0, 0, CGame::GetInstance()->GetPlayW(), 100};
	//CBitmapFont::GetInstance()->PrintInRect("Skills Upgrade State", &rSkillsTitle, ALIGN_CENTER, 0xff0000ff);
	//BF.PrintText("SKILLS UPGRADE STATE", 10, 10, 1, D3DCOLOR_XRGB(255, 255, 255), true);

	/*sprintf_s( buffer, "<%d>", int( m_nFXVolume * 100));
	BF.PrintText("SFX Volume", 100, 50, 0.75f, D3DCOLOR_XRGB(255, 255, 255));
	BF.PrintText(buffer, 400, 50, 0.75f, D3DCOLOR_XRGB(255, 255, 255));*/

	int schoolX_1 = 100;
	int schoolY_1 = 50;
	float schoolScale = 0.5f;
	int spellsX_1 = schoolX_1 + 25;
	int spellsY_1 = schoolY_1 + 25;
	float spellsScale = 0.35f;

	int schoolX_2 = schoolX_1;
	int schoolY_2 = schoolY_1 + 200;
	int spellsX_2 = spellsX_1;
	int spellsY_2 = spellsY_1 + 200;

	int turnPageX = 120;
	int pageBackY = 400;
	int pageForwardY = pageBackY + 30;

	int mouseOneX = schoolX_1 - 64;
	int mouseTwoX = schoolX_1 - 32;
	int spacing = 24;

	int instructionsX = 425;
	int instructionsY = 50;
	int SpellDescriptionRedX = instructionsX;
	int SpellDescriptionRedY = instructionsY + 50;
	int SpellDescriptionBlueX = SpellDescriptionRedX;
	int SpellDescriptionBlueY = SpellDescriptionRedY + 150;

	RECT rRedDescriptionText  = {SpellDescriptionRedX, SpellDescriptionRedY, SpellDescriptionRedX + 350, SpellDescriptionRedY + 200};
	RECT rBlueDescriptionText = {SpellDescriptionBlueX, SpellDescriptionBlueY, SpellDescriptionBlueX + 350, SpellDescriptionBlueY + 200};

	
	switch(m_nPage)
	{
	case 0:
		{
			DrawTraps(schoolX_1, schoolY_1, schoolScale, spellsX_1, spellsY_1, spellsScale);
			DrawEvocation(schoolX_2, schoolY_2, schoolScale, spellsX_2, spellsY_2, spellsScale);
			DrawPageForward(turnPageX, pageForwardY, 0.2f);			
		}
		break;

	case 1:
		{
			DrawRestoration(schoolX_1, schoolY_1, schoolScale, spellsX_1, spellsY_1, spellsScale);
			DrawTransmutation(schoolX_2, schoolY_2, schoolScale, spellsX_2, spellsY_2, spellsScale);
			DrawPageBack(turnPageX, pageBackY, 0.2f);
			DrawPageForward(turnPageX, pageForwardY, 0.2f);			
		}
		break;

	case 2:
		{
			DrawNecromancy(schoolX_1, schoolY_1, schoolScale, spellsX_1, spellsY_1, spellsScale);
			DrawPageBack(turnPageX, pageBackY, 0.2f);
		}
		break;
	}
	
	DrawInstructions(instructionsX, instructionsY, 0.22f);
	
	CHud::GetInstance()->DrawHUDBar();

#pragma region draw the selection cursors
	//draw the cursor at the current selection
	switch(m_nPage)
	{
	case 0:	// page 1
		{
			// PLAYER ONE
			switch(m_nMenuSelectionOne)
			{
			case SKILLSMENU_PROXMINE:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (SKILLSMENU_PROXMINE * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_REMOTEMINE:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (SKILLSMENU_REMOTEMINE * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_DECOY:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (SKILLSMENU_DECOY * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_BARRIER:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (SKILLSMENU_BARRIER * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_IMMOLATION:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_2 + 20) + (FIRST_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FIREBALL:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_2 + 20) + (SECOND_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;
				
			case SKILLSMENU_FROSTSPRAY:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_2 + 20) + (THIRD_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_ICEBLAST:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_2 + 20) + (FOURTH_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FORWARD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageForwardY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;
			}

			// PLAYER TWO
			switch(m_nMenuSelectionTwo)
			{
			case SKILLSMENU_PROXMINE:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (SKILLSMENU_PROXMINE * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_REMOTEMINE:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (SKILLSMENU_REMOTEMINE * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_DECOY:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (SKILLSMENU_DECOY * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_BARRIER:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (SKILLSMENU_BARRIER * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_IMMOLATION:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_2 + 20) + (FIRST_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FIREBALL:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_2 + 20) + (SECOND_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;
				
			case SKILLSMENU_FROSTSPRAY:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_2 + 20) + (THIRD_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_ICEBLAST:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_2 + 20) + (FOURTH_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FORWARD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageForwardY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;
			}
		}
		break;

	case 1:	// page 2
		{
			// PLAYER ONE
			switch(m_nMenuSelectionOne)
			{
			case SKILLSMENU_HEALSELF:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (FIRST_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_HEALALLY:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (SECOND_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_MANAGIFT:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (THIRD_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_HEALCIRCLE:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (FOURTH_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FORTIFYSELF:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_2 + 20) + (FIRST_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FORTIFYALLY:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_2 + 20) + (SECOND_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;
				
			case SKILLSMENU_SPRINT:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_2 + 20) + (THIRD_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_EMPOWER:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_2 + 20) + (FOURTH_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FORWARD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageForwardY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;
			}

			// PLAYER TWO
			switch(m_nMenuSelectionTwo)
			{
			case SKILLSMENU_HEALSELF:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (FIRST_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_HEALALLY:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (SECOND_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_MANAGIFT:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (THIRD_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_HEALCIRCLE:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (FOURTH_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FORTIFYSELF:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_2 + 20) + (FIRST_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FORTIFYALLY:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_2 + 20) + (SECOND_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;
				
			case SKILLSMENU_SPRINT:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_2 + 20) + (THIRD_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_EMPOWER:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_2 + 20) + (FOURTH_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FORWARD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageForwardY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;
			}
		}
		break;

	case 2:	// page 3
		{
			// PLAYER ONE
			switch(m_nMenuSelectionOne)
			{
			case SKILLSMENU_RAISEDEAD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (FIRST_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_LIFEDRAIN:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (SECOND_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_PLAGUE:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (THIRD_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FEARSYMBOL:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (spellsY_1 + 20) + (FOURTH_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			}

			// PLAYER TWO
			switch(m_nMenuSelectionTwo)
			{
			case SKILLSMENU_RAISEDEAD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (FIRST_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_LIFEDRAIN:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (SECOND_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_PLAGUE:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (THIRD_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FEARSYMBOL:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (spellsY_1 + 20) + (FOURTH_SELECTION * spacing), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			}
		}
		break;
	}
#pragma endregion

#pragma region spell descriptions text
	// Spell Descriptions Text
	CBitmapFont::GetInstance()->SetScale(0.25f);
	switch(m_nPage)
	{
	case 0:	// page 1
		{
			// PLAYER ONE
			switch(m_nMenuSelectionOne)
			{
			case SKILLSMENU_PROXMINE:
				{											
					CBitmapFont::GetInstance()->PrintInRect("Lay a proximity rune at your feet. After a\nshort delay, any character that steps\nnear the mine will cause a large explosion,\ndamaging nearby players and enemies.\n\nMana Cost: 17          Damage: 100\nRange: Self",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_REMOTEMINE:
				{
					CBitmapFont::GetInstance()->PrintInRect("Lay a remote rune at your feet. Cast again\nto detonate your rune. All players and\nenemies in the blast radius will take\ndamage from the explosion.\n\nMana Cost: Lay: 25  Detonate: 0   Damage: 100\nRange: Self",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_DECOY:
				{
					CBitmapFont::GetInstance()->PrintInRect("Lay a decoy in front of you. Enemies will\nseek and attack the decoy if it is closer\nthan real players.\nThe decoy has 100 health.\n\nMana Cost: 20 \nRange: Adjacent",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_BARRIER:
				{
					CBitmapFont::GetInstance()->PrintInRect("Lay a magical barrier in front of you.\nEnemies and players are unable to move\nthrough the barrier. Enemy spells that\ndeflect off the barrier may harm the enemy.\n\nMana Cost: 10        Duration: 3 seconds\nRange: Short",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_IMMOLATION:
				{
					CBitmapFont::GetInstance()->PrintInRect("Casting Immolation toggles flame to\nsurround your body. Adjacent enemies take\nburn damage. Immolation slowly\nconsumes mana over time.\n\nMana Cost: 5 / second      Duration: 15 / second\nRange: Self",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FIREBALL:
				{
					CBitmapFont::GetInstance()->PrintInRect("Hurl a ball of magical fire at your foes.\nUpon collision, there is a small explosion,\ndealing damage to nearby enemies.\n\nMana Cost: 20          Damage: 60\nRange: Long",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;
				
			case SKILLSMENU_FROSTSPRAY:
				{
					CBitmapFont::GetInstance()->PrintInRect("Pelt nearby enemies with a spray of frost.\nEnemies are temporarily slowed from frost.\nFrost Spray slowly consumes mana\nover time.\n\nMana Cost: 5 / second      Damage: 10 / second\nRange: Short",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_ICEBLAST:
				{
					CBitmapFont::GetInstance()->PrintInRect("Hurl a large chunk of ice at your foes.\nEnemies are temporarily frozen when hit.\n\nMana Cost: 20         Damage: 20\nRange: Long",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FORWARD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageForwardY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;
			}

			// PLAYER TWO
			switch(m_nMenuSelectionTwo)
			{
			case SKILLSMENU_PROXMINE:
				{
					CBitmapFont::GetInstance()->PrintInRect("Lay a proximity rune at your feet. After a\nshort delay, any character that steps\nnear the mine will cause a large explosion,\ndamaging nearby players and enemies.\n\nMana Cost: 17          Damage: 100\nRange: Self",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_REMOTEMINE:
				{
					CBitmapFont::GetInstance()->PrintInRect("Lay a remote rune at your feet. Cast again\nto detonate your rune. All players and\nenemies in the blast radius will take\ndamage from the explosion.\n\nMana Cost: Lay: 25  Detonate: 0   Damage: 100\nRange: Self",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_DECOY:
				{
					CBitmapFont::GetInstance()->PrintInRect("Lay a decoy in front of you. Enemies will\nseek and attack the decoy if it is closer\nthan real players.\nThe decoy has 100 health.\n\nMana Cost: 20 \nRange: Adjacent",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_BARRIER:
				{
					CBitmapFont::GetInstance()->PrintInRect("Lay a magical barrier in front of you.\nEnemies and players are unable to move\nthrough the barrier. Enemy spells that\ndeflect off the barrier may harm the enemy.\n\nMana Cost: 10        Duration: 3 seconds\nRange: Short",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_IMMOLATION:
				{
					CBitmapFont::GetInstance()->PrintInRect("Casting Immolation toggles flame to\nsurround your body. Adjacent enemies take\nburn damage. Immolation slowly\nconsumes mana over time.\n\nMana Cost: 5 / second      Duration: 15 / second\nRange: Self",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FIREBALL:
				{
					CBitmapFont::GetInstance()->PrintInRect("Hurl a ball of magical fire at your foes.\nUpon collision, there is a small explosion,\ndealing damage to nearby enemies.\n\nMana Cost: 20          Damage: 60\nRange: Long",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;
				
			case SKILLSMENU_FROSTSPRAY:
				{
					CBitmapFont::GetInstance()->PrintInRect("Pelt nearby enemies with a spray of frost.\nEnemies are temporarily slowed from frost.\nFrost Spray slowly consumes mana\nover time.\n\nMana Cost: 5 / second      Damage: 10 / second\nRange: Short",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_ICEBLAST:
				{
					CBitmapFont::GetInstance()->PrintInRect("Hurl a large chunk of ice at your foes.\nEnemies are temporarily frozen when hit.\n\nMana Cost: 20         Damage: 20\nRange: Long",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FORWARD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageForwardY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;
			}
		}
		break;

	case 1:	// page 2
		{
			// PLAYER ONE
			switch(m_nMenuSelectionOne)
			{
			case SKILLSMENU_HEALSELF:
				{
					CBitmapFont::GetInstance()->PrintInRect("Restore some of your health. You\ncannot heal more health than your max.\n\nMana Cost: 10         Heals: 20\nRange: Self",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_HEALALLY:
				{
					CBitmapFont::GetInstance()->PrintInRect("Fire out positive energy. Your ally\nwill restore health upon contact.\n\nMana Cost: 10         Heals: 30\nRange: Medium",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_MANAGIFT:
				{
					CBitmapFont::GetInstance()->PrintInRect("Donate some of your mana. Your ally\nwill restore mana upon contact.\n\nMana Cost: 25         Restores: 25\nRange: Medium",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_HEALCIRCLE:
				{
					CBitmapFont::GetInstance()->PrintInRect("Cast an arcane healing circle upon the\nground. You and your ally will restore \nhealth over time if standing on the\ncircle.\n\nMana Cost: 30         Duration: 3.5 seconds\nRange: Self",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FORTIFYSELF:
				{
					CBitmapFont::GetInstance()->PrintInRect("Grant yourself magic armor for a\nlimited time. All damage you take is\nreduced during this time.\n\nMana Cost: 15         Duration: 7 seconds\nRange: Self",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FORTIFYALLY:
				{
					CBitmapFont::GetInstance()->PrintInRect("Cast out magic armor for your ally.\nUpon contact, your ally receives damage\nreduction for a short time.\n\nMana Cost: 10         Duration: 8 seconds\nRange: Medium",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;
				
			case SKILLSMENU_SPRINT:
				{
					CBitmapFont::GetInstance()->PrintInRect("You feel invigorated as you cast Sprint.\nYour movement speed is doubled. \n\nMana Cost: 10         Duration: 6 seconds\nRange: Self",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_EMPOWER:
				{
					CBitmapFont::GetInstance()->PrintInRect("You expel a blast of raw power. Upon\ncontact, your ally deals double damage\n with all damaging spells except traps. \n\nMana Cost: 20         Duration: 6 seconds\nRange: Short",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FORWARD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageForwardY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;
			}

			// PLAYER TWO
			switch(m_nMenuSelectionTwo)
			{
			case SKILLSMENU_HEALSELF:
				{
					CBitmapFont::GetInstance()->PrintInRect("Restore some of your health. You\ncannot heal more health than your max.\n\nMana Cost: 10         Heals: 20\nRange: Self",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_HEALALLY:
				{
					CBitmapFont::GetInstance()->PrintInRect("Fire out positive energy. Your ally\nwill restore health upon contact.\n\nMana Cost: 10         Heals: 30\nRange: Medium",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_MANAGIFT:
				{
					CBitmapFont::GetInstance()->PrintInRect("Donate some of your mana. Your ally\nwill restore mana upon contact.\n\nMana Cost: 25         Restores: 25\nRange: Medium",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_HEALCIRCLE:
				{
					CBitmapFont::GetInstance()->PrintInRect("Cast an arcane healing circle upon the\nground. You and your ally will restore \nhealth over time if standing on the\ncircle.\n\nMana Cost: 30         Duration: 3.5 seconds\nRange: Self",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FORTIFYSELF:
				{
					CBitmapFont::GetInstance()->PrintInRect("Grant yourself magic armor for a\nlimited time. All damage you take is\nreduced during this time.\n\nMana Cost: 15         Duration: 7 seconds\nRange: Self",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FORTIFYALLY:
				{
					CBitmapFont::GetInstance()->PrintInRect("Cast out magic armor for your ally.\nUpon contact, your ally receives damage\nreduction for a short time.\n\nMana Cost: 10         Duration: 8 seconds\nRange: Medium",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;
				
			case SKILLSMENU_SPRINT:
				{
					CBitmapFont::GetInstance()->PrintInRect("You feel invigorated as you cast Sprint.\nYour movement speed is doubled. \n\nMana Cost: 10         Duration: 6 seconds\nRange: Self",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_EMPOWER:
				{
					CBitmapFont::GetInstance()->PrintInRect("You expel a blast of raw power. Upon\ncontact, your ally deals double damage\n with all damaging spells except traps. \n\nMana Cost: 20         Duration: 6 seconds\nRange: Short",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FORWARD:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageForwardY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;
			}
		}
		break;

	case 2:	// page 3
		{
			// PLAYER ONE
			switch(m_nMenuSelectionOne)
			{
			case SKILLSMENU_RAISEDEAD:
				{
					CBitmapFont::GetInstance()->PrintInRect("Bring a fallen enemy back from the dead.\nYour new ally will fight for your cause.\nYou may have a maximum of 2 thralls.\n\nMana Cost: 30         \nRange: Short",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_LIFEDRAIN:
				{
					CBitmapFont::GetInstance()->PrintInRect("Attack your foes with a stream of life-\nabsorbing magic. You heal health while\ndealing damage. Life Drain slowly\nconsumes mana over time.\n\nMana Cost: 12 / second      Damage: 12 / second\nRange: Medium",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_PLAGUE:
				{
					CBitmapFont::GetInstance()->PrintInRect("Spew a plague of death upon your enemies.\nIf afflicted, your foe will take\ndamage over time.\n\nMana Cost: 20      Damage: 10 / second\nRange: Medium",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			case SKILLSMENU_FEARSYMBOL:
				{
					CBitmapFont::GetInstance()->PrintInRect("Cast a symbol of fear at your feet.\nEnemies will flee from the symbol when\nclose.\n\nMana Cost: 20      Duration: 5 seconds\nRange: Self",&rRedDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseOneX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(255, 20, 20) );
				}
				break;

			}

			// PLAYER TWO
			switch(m_nMenuSelectionTwo)
			{
			case SKILLSMENU_RAISEDEAD:
				{
					CBitmapFont::GetInstance()->PrintInRect("Bring a fallen enemy back from the dead.\nYour new ally will fight for your cause.\nYou may have a maximum of 2 thralls.\n\nMana Cost: 30         \nRange: Short",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_LIFEDRAIN:
				{
					CBitmapFont::GetInstance()->PrintInRect("Attack your foes with a stream of life-\nabsorbing magic. You heal health while\ndealing damage. Life Drain slowly\nconsumes mana over time.\n\nMana Cost: 12 / second      Damage: 12 / second\nRange: Medium",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_PLAGUE:
				{
					CBitmapFont::GetInstance()->PrintInRect("Spew a plague of death upon your enemies.\nIf afflicted, your foe will take\ndamage over time.\n\nMana Cost: 20      Damage: 10 / second\nRange: Medium",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			case SKILLSMENU_FEARSYMBOL:
				{
					CBitmapFont::GetInstance()->PrintInRect("Cast a symbol of fear at your feet.\nEnemies will flee from the symbol when\nclose.\n\nMana Cost: 20      Duration: 5 seconds\nRange: Self",&rBlueDescriptionText, ALIGN_LEFT, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

				case SKILLSMENU_BACK:
				{
					CSGD_TextureManager::GetInstance()->Draw(m_nCursorID, mouseTwoX, (pageBackY + 10), 1.0f, 1.0f, 0, 0, 0, 0, D3DCOLOR_XRGB(20, 20, 255) );
				}
				break;

			}
		}
		break;
	}
#pragma endregion
	
}
void CSkillsUpgradeState::Exit(void)
{
	//TODO: update the stage to next one 
	
	/*CSGD_FModManager::GetInstance()->StopSound(m_nSFX);
	CSGD_FModManager::GetInstance()->StopSound(m_nBGM);
	
	CSGD_FModManager::GetInstance()->UnloadSound(m_nSFX);
	CSGD_FModManager::GetInstance()->UnloadSound(m_nBGM);

	CGame::GetInstance()->SetMusicVolume(m_nMusicVolume);
	CGame::GetInstance()->SetPanVolume(m_nMusicPan);
	CGame::GetInstance()->SetSFXVolume(m_nFXVolume);*/
}

void CSkillsUpgradeState::DrawTraps(int schoolX, int schoolY, float schoolScale, int spellsX, int spellsY, float spellsScale)
{
	RECT rSChool = {schoolX, schoolY, schoolX + 200, schoolY + 45};
	RECT rSpells = {spellsX, spellsY, spellsX + 200, spellsY + 120};

	CBitmapFont::GetInstance()->SetScale(schoolScale);
	CBitmapFont::GetInstance()->PrintInRect("Traps", &rSChool, ALIGN_CENTER, D3DCOLOR_XRGB(225, 225, 225));

	CBitmapFont::GetInstance()->SetScale(spellsScale);
	CBitmapFont::GetInstance()->PrintInRect("Proximity Rune\nRemote Rune\nDecoy\nBarrier", &rSpells, ALIGN_LEFT, D3DCOLOR_XRGB(225, 225, 225));
}

void CSkillsUpgradeState::DrawEvocation(int schoolX, int schoolY, float schoolScale, int spellsX, int spellsY, float spellsScale)
{
	RECT rSChool = {schoolX, schoolY, schoolX + 200, schoolY + 45};
	RECT rSpells = {spellsX, spellsY, spellsX + 200, spellsY + 120};

	CBitmapFont::GetInstance()->SetScale(schoolScale);
	CBitmapFont::GetInstance()->PrintInRect("Evocation", &rSChool, ALIGN_CENTER, D3DCOLOR_XRGB(225, 225, 225));

	CBitmapFont::GetInstance()->SetScale(spellsScale);
	CBitmapFont::GetInstance()->PrintInRect("Immolation\nFireball\nFrost Spray\nIce Blast", &rSpells, ALIGN_LEFT, D3DCOLOR_XRGB(225, 225, 225));
}

void CSkillsUpgradeState::DrawRestoration(int schoolX, int schoolY, float schoolScale, int spellsX, int spellsY, float spellsScale)
{
	RECT rSChool = {schoolX, schoolY, schoolX + 200, schoolY + 45};
	RECT rSpells = {spellsX, spellsY, spellsX + 200, spellsY + 120};

	CBitmapFont::GetInstance()->SetScale(schoolScale);
	CBitmapFont::GetInstance()->PrintInRect("Restoration", &rSChool, ALIGN_CENTER, D3DCOLOR_XRGB(225, 225, 225));

	CBitmapFont::GetInstance()->SetScale(spellsScale);
	CBitmapFont::GetInstance()->PrintInRect("Heal Self\nHeal Ally\nMana Gift\nHealing Circle", &rSpells, ALIGN_LEFT, D3DCOLOR_XRGB(225, 225, 225));
}

void CSkillsUpgradeState::DrawTransmutation(int schoolX, int schoolY, float schoolScale, int spellsX, int spellsY, float spellsScale)
{
	RECT rSChool = {schoolX, schoolY, schoolX + 200, schoolY + 45};
	RECT rSpells = {spellsX, spellsY, spellsX + 200, spellsY + 120};

	CBitmapFont::GetInstance()->SetScale(schoolScale);
	CBitmapFont::GetInstance()->PrintInRect("Transmutation", &rSChool, ALIGN_CENTER, D3DCOLOR_XRGB(225, 225, 225));

	CBitmapFont::GetInstance()->SetScale(spellsScale);
	CBitmapFont::GetInstance()->PrintInRect("Fortify Self\nFortify Ally\nSprint\nEmpower", &rSpells, ALIGN_LEFT, D3DCOLOR_XRGB(225, 225, 225));
}

void CSkillsUpgradeState::DrawNecromancy(int schoolX, int schoolY, float schoolScale, int spellsX, int spellsY, float spellsScale)
{
	RECT rSChool = {schoolX, schoolY, schoolX + 200, schoolY + 45};
	RECT rSpells = {spellsX, spellsY, spellsX + 200, spellsY + 120};

	CBitmapFont::GetInstance()->SetScale(schoolScale);
	CBitmapFont::GetInstance()->PrintInRect("Necromancy", &rSChool, ALIGN_CENTER, D3DCOLOR_XRGB(225, 225, 225));

	CBitmapFont::GetInstance()->SetScale(spellsScale);
	CBitmapFont::GetInstance()->PrintInRect("Raise Dead\nLife Drain\nPlague\nSymbol of Fear", &rSpells, ALIGN_LEFT, D3DCOLOR_XRGB(225, 225, 225));
}

void CSkillsUpgradeState::DrawPageForward(int posX, int posY, float scale)
{
	RECT rect = {posX, posY, posX + 100, posY + 32};

	CBitmapFont::GetInstance()->SetScale(scale);
	CBitmapFont::GetInstance()->PrintInRect("Turn Page Forward", &rect, ALIGN_LEFT, D3DCOLOR_XRGB(225, 225, 225));
}

void CSkillsUpgradeState::DrawPageBack(int posX, int posY, float scale)
{
	RECT rect = {posX, posY, posX + 100, posY + 32};

	CBitmapFont::GetInstance()->SetScale(scale);
	CBitmapFont::GetInstance()->PrintInRect("Turn Page Back", &rect, ALIGN_LEFT, D3DCOLOR_XRGB(225, 225, 225));
}

void CSkillsUpgradeState::DrawInstructions(int posX, int posY, float scale)
{
	RECT rect = {posX, posY, posX + 350, posY + 100};

	CBitmapFont::GetInstance()->SetScale(scale);
	CBitmapFont::GetInstance()->PrintInRect("To learn a new spell, move your cursor to the spell\nyou wish to learn. Press an unequipped button\nto assign your spell to it.\nWhen you are finished, press Start.", &rect, ALIGN_LEFT, D3DCOLOR_XRGB(225, 225, 225));
}